<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>React的组件</title>
  <script src="https://cdn.staticfile.org/react/16.4.0/umd/react.development.js"></script>
  <script src="https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.development.js"></script>
  <script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
const author = {avatarUrl:'https://www.linuxidc.com/upload/2016_01/160113120374392.png',name:'React学习'}
function Avatar(props) {
  return (
    <img className="Avatar"
         src={props.user.avatarUrl}
         alt={props.user.name}
    />

  );
}
function render() {
  const element = (
    <div>
   <Avatar user={author}></Avatar>
  </div>
);
  ReactDOM.render(element, document.getElementById('root'));
}
render();
</script>
</body>
</html>
